import { Rule, RuleType } from "@midwayjs/validate"
import { CommonAuditStatus } from "../../../interface"
import { CoolValidateException } from "@cool-midway/core"
import moment = require("moment")


export class AddStorageInfoDTO {
    @Rule(RuleType.number().required().error(new CoolValidateException('请选择上架至云仓的产品')))
    productId: number;
    @Rule(RuleType.date().optional().default(moment().add(30, 'days').toDate()))
    expireDate?: Date
    @Rule(RuleType.allow(CommonAuditStatus.APPROVED, CommonAuditStatus.REJECTED).optional().default(CommonAuditStatus.PENDING))
    status?: CommonAuditStatus
}


export class AuditStorageInfoDTO {
    @Rule(RuleType.number().required().error(new CoolValidateException('请选择要审核的云仓产品')))
    id: number;
    @Rule(RuleType.allow(CommonAuditStatus.APPROVED, CommonAuditStatus.REJECTED).required().error(new CoolValidateException('请选择审核状态')))
    status: CommonAuditStatus;
    @Rule(RuleType.string().optional().allow(''))
    rejectReason?: string;
}